package com.chennan;

import com.chennan.rebbitmq.leading.consumer.MyStreamClient;
import com.chennan.rebbitmq.leading.producer.MyStreamOutput;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.apache.catalina.startup.Tomcat;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.retry.annotation.EnableRetry;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;

@SpringBootApplication
@EnableConfigurationProperties(ServerProperties.class)
@EnableSwagger2
@MapperScan({"com.chennan.**.repository","com.chennan.**.mapper"})
//@ComponentScan(basePackages = {"com.chennan.*"})
//@EnableBinding({MyStreamOutput.class, MyStreamClient.class})
@ImportResource({"classpath:elastic-job.xml"})
@ServletComponentScan(basePackages = "com.chennan")
@EnableRetry
//@EnableApolloConfig
//@EnableFeignClients
public class Gams2Application {

	public static void main(String[] args) {
		SpringApplication.run(Gams2Application.class, args);
	}
//	Tomcat tomcat = new Tomcat();

	@Bean
	public PodamFactory PodamFactory() {
		Tomcat tomcat = new Tomcat();
//		tomcat.addContext();



		return new PodamFactoryImpl();
	}
}
